package com.wenjoying.goods.controller;

import com.alibaba.fastjson.JSONObject;
import com.wenjoying.common.api.BaseController;
import com.wenjoying.common.api.BaseException;
import com.wenjoying.common.api.CommonResult;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "goods/goods")
public class GoodsController extends BaseController {

    @RequestMapping(value = "testApi", method = RequestMethod.POST)
    public CommonResult testApi(@RequestBody JSONObject jsonObject){
        try {
            System.err.println("laile");
            return CommonResult.success(jsonObject);
        } catch (Exception e) {
            throw new BaseException(e);
        }
    }

    @RequestMapping(value = "testApi2", method = RequestMethod.GET)
    public CommonResult testApi2(){
        try {
            return CommonResult.success("laile");
        } catch (Exception e) {
            throw new BaseException(e);
        }
    }
}
